import request from '@/utils/request'

// 查询列表
export function list(query) {
  return request({
    url: '/system/dictData/page',
    method: 'get',
    params: query
  })
}

// 新增
export function add(data) {
  return request({
    url: '/system/dictData',
    method: 'post',
    data: data
  })
}

// 修改
export function update(data) {
  return request({
    url: '/system/dictData',
    method: 'patch',
    data: data
  })
}

// 删除
export function deleteData(ids) {
  return request({
    url: '/system/dictData',
    method: 'delete',
    data: ids
  })
}

// 导出
export function exportData(data, pageParam) {
  return request({
    responseType: 'blob',
    url: '/system/dictData/download/excel' + pageParam,
    method: 'post',
    data: data
  })
}

// 导入
export function uploadData(data) {
  return request({
    url: '/system/dictData/upload/excel',
    method: 'post',
    data: data
  })
}

// 查询导入Excel表头属性
export function listExcelHeader() {
  return request({
    url: '/system/dictData/excel/header',
    method: 'get'
  })
}
